";
else if ($attrs['PRICEVARIANCE'] != "")
$imagestring.= " pricevariance=\"". $attrs['PRICEVARIANCE']."\">";
else
$imagestring.= ">";
array_push($itemarray,$imagestring);
array_push($itemarray,"");
}
else {
$bufferstring = "";
else if ($attrs['PRICEVARIANCE'] != "")
$bufferstring.= " pricevariance=\"". $attrs['PRICEVARIANCE']."\">";
$bufferstring.= ">";
}
};
if ($name == "DESCRIPTION") {
if (isset($itemarray) && $searchfound=="Y") {
array_push($itemarray,"" );
}
else {
if ($searchmeta =="Y") {
$attr_merged = array_to_string($attrs);
if (isset($itemarray) && $searchfound=="N" && generic_search($attr_merged, $searchfor, $searchmode) ) {
array_push($itemarray,$bufferstring);
array_push($itemarray,"" );
$searchfound="Y" ;
}
}
}
if (isset($itemarray) && $searchfound=="N") {
$bufferstring .= "";
}
}
if ($name == "IPTC") {
if (isset($itemarray) && $searchfound=="Y") {
array_push($itemarray,"" );
}
else {
if ($searchmeta =="Y") {
$attr_merged = array_to_string($attrs);
if (isset($itemarray) && $searchfound=="N" && generic_search($attr_merged, $searchfor, $searchmode) ) {
array_push($itemarray,$bufferstring);
array_push($itemarray,"" );
$searchfound="Y" ;
}
}
}
}
$depth[$parser]++;
}
//****************************************************************************************************************
function endElement($parser, $name)
{
global $depth, $currentTag, $currentAttribs, $itemarray, $mainsort,$searchfound,$bufferstring ;
$depth[$parser]--;
$currentTag = "";
$currentAttribs = "";
if ($name == "IMAGE" ) {
if (isset($itemarray) && $searchfound=="Y") {
array_push($itemarray,"");
array_push($mainsort,$itemarray);
}
};
if ($name == "DESCRIPTION") {
if (isset($itemarray) && $searchfound=="Y") {
array_push($itemarray,"]]>");
}
if (isset($itemarray) && $searchfound=="N") {
$bufferstring .= "]]>";
}
};
if ($name == "EXIF" ) {
if (isset($itemarray) && $searchfound=="Y") {
array_push($itemarray,"");
}
if (isset($itemarray) && $searchfound=="N") {
$bufferstring .= "";
}
};
if ($name == "IPTC" ) {
if (isset($itemarray) && $searchfound=="Y") {
array_push($itemarray,"");
}
};
}
//****************************************************************************************************************
function characterData($parser, $data)
{
global $currentTag, $itemarray,$searchfound,$bufferstring,$searchfor,$searchdesc,$searchmode ;
switch ($currentTag) {
case "DESCRIPTION":
if ($searchfound =="Y") {
array_push($itemarray,utf8_encode($data));
}
if ( $searchfound =="N" && $searchdesc =="Y" && generic_search($data, $searchfor, $searchmode) ){
array_push($itemarray,$bufferstring);
// array_push($itemarray,"".$search_term."".$searchable."\r\n";
};
if ($search_type == "")
{
if (eregi($search_term, $searchable)) {
foreach ($exclude_search_words as $term)
{
if (eregi($term, $searchable)) { return FALSE; }
}
return TRUE;
}
else return FALSE;
}
elseif ($search_type == "AND")
{
foreach ($include_search_words as $term)
{
if (!eregi($term, $searchable)) { return FALSE; }
}
foreach ($exclude_search_words as $term)
{
if (eregi($term, $searchable)) { return FALSE; }
}
return TRUE;
}
elseif ($search_type == "OR")
{
$return_flag = 0;
foreach ($include_search_words as $term)
{
if (eregi($term, $searchable)) { $return_flag = 1;break; }
}
if ($return_flag == 0) return FALSE;
else
{
foreach ($exclude_search_words as $term)
{
if (eregi($term, $searchable)) { return FALSE; }
}
return TRUE;
}
}
}
//****************************************************************************************************************
function array_to_string($array) {
$retval = '';
$null_value = "^^^";
foreach ($array as $index => $value) {
if (!$value)
$value = $null_value;
$retval .= trim($value) . ' ';
}
return $retval;
}
//****************************************************************************************************************
$URL_IMG = 'http://' . $_SERVER['SERVER_NAME'];
$URL_IMG.= dirname($_SERVER['PHP_SELF']);
$tm=time(); $tm=date("D, d M Y H:i:s",$tm);
$tm=$tm. " GMT"; // you can add your format
if (isset($_REQUEST["debug"]))
header("Content-Type: text/text; charset=utf-8");
else
header("Content-Type: text/xml; charset=utf-8");
echo "";
echo "";
global $mainsort;
$mainsort = array();
if ($albumpath != "" && $albumpath != "all/") {
$xmlpath = $albumpath."photos.xml";
if (file_exists($xmlpath)) {
processalbum($xmlpath,$albumpath);
}
}
if ($albumpath == "" ) {
$xmlpath = "photos.xml";
if (file_exists($xmlpath)) {
processalbum($xmlpath,$albumpath);
}
map_dirs(".");
}
function map_dirs($path) {
if(is_dir($path)) {
if($contents = opendir($path)) {
while(($node = readdir($contents)) !== false) {
if( (!strpos($node,".")) && $node!="res" && $node !="images" && $node != "slides" && $node !="thumbs" && $node !="rss_styles" && $node!= "." && $node!= ".." ) {
if ($path==".") {
$folpath = $node."/";
if (file_exists($folpath."photos.xml")) {
processalbum($folpath."photos.xml",$folpath);
}
}
else {
$folpath = $path."/".$node."/";
$folpath = ltrim($folpath,'./');
if (file_exists($folpath."photos.xml")) {
processalbum($folpath."photos.xml",$folpath);
}
}
map_dirs("$path/$node");
}
}
}
}
}
echo("");
?>